import axios from '../../../plugins/axios'
import { BannerActionsEnum } from '../../../_/vue/store/banner'
export default {
  [BannerActionsEnum.LIST] ({ commit }, params) {
    return axios.get('/banners', { params })
  },
  [BannerActionsEnum.STORE] ({ commit }, data) {
    return axios.post('/banners', data)
  },
  [BannerActionsEnum.EDIT] ({ commit }, id) {
    return axios.get(`/banners/${id}`)
  },
  [BannerActionsEnum.SAVE] ({ commit }, { id, data }) {
    return axios.post(`/banners/${id}`, data)
  },
  [BannerActionsEnum.DELETE] ({ commit }, ids) {
    return axios.delete('/banners', { data: ids })
  },
  [BannerActionsEnum.SWITCH] ({ commit }, data) {
    return axios.post('/banners/switch', data)
  }
}
